package hero

// CreatureInfoKey 假设这是一个定义了一些常量的结构体，这里简单模拟
type CreatureInfoKey struct {
	hp         string
	phyAttack  string
	killAttack string
	mgcAttack  string
	phyDefend  string
	mgcDefend  string
	killDefend string
}

// HeroDef 对应 PHP 中的 HeroDef 类
var HeroDef struct {
	// 英雄表字段
	HERO_FIELDS []string
	// 英雄在酒馆
	STATUS_PUB int
	// 英雄被招募
	STATUS_RECRUIT int
}

// GoodwillAttr 对应 PHP 中的 GoodwillAttr 类
var GoodwillAttr struct {
	// 生命基础
	HP_BASE int
	// 物理攻击基础
	PHY_ATK_BASE int
	// 必杀攻击基础
	KILL_ATK_BASE int
	// 魔法攻击基础
	MGC_ATK_BASE int
	// 物理防御基础
	PHY_DEFEND_BASE int
	// 魔法防御基础
	MGC_DEFEND_BASE int
	// 必杀防御基础
	KILL_DEFEND_BASE int
	// 最终生命
	HP_FINAL int
	// 属性映射
	ArrAttrGwMap map[int]string
}

func init() {
	// 初始化 HeroDef
	HeroDef.HERO_FIELDS = []string{
		"hid",
		"htid",
		"uid",
		"curHp",
		"status",
		"level",
		"upgrade_time",
		"rebirthNum",
		"exp",
		"va_hero",
	}
	HeroDef.STATUS_PUB = 1
	HeroDef.STATUS_RECRUIT = 2
	// 初始化 CreatureInfoKey
	ciKey := CreatureInfoKey{
		hp:         "hp",
		phyAttack:  "phyAttack",
		killAttack: "killAttack",
		mgcAttack:  "mgcAttack",
		phyDefend:  "phyDefend",
		mgcDefend:  "mgcDefend",
		killDefend: "killDefend",
	}
	// 初始化 GoodwillAttr
	GoodwillAttr.HP_BASE = 1
	GoodwillAttr.PHY_ATK_BASE = 6
	GoodwillAttr.KILL_ATK_BASE = 7
	GoodwillAttr.MGC_ATK_BASE = 8
	GoodwillAttr.PHY_DEFEND_BASE = 9
	GoodwillAttr.MGC_DEFEND_BASE = 10
	GoodwillAttr.KILL_DEFEND_BASE = 11
	GoodwillAttr.HP_FINAL = 46
	GoodwillAttr.ArrAttrGwMap = map[int]string{
		GoodwillAttr.HP_BASE:          ciKey.hp,
		GoodwillAttr.PHY_ATK_BASE:     ciKey.phyAttack,
		GoodwillAttr.KILL_ATK_BASE:    ciKey.killAttack,
		GoodwillAttr.MGC_ATK_BASE:     ciKey.mgcAttack,
		GoodwillAttr.PHY_DEFEND_BASE:  ciKey.phyDefend,
		GoodwillAttr.MGC_DEFEND_BASE:  ciKey.mgcDefend,
		GoodwillAttr.KILL_DEFEND_BASE: ciKey.killDefend,
	}
}
